package com.hsmpay.utils;

public class StringBUtils {
	/**
	 * 补全数字 为len 长的字符串
	 * @param str
	 * @param len
	 * @return
	 */
	public static String supplyAll(Object str,int len){
		StringBuilder sb = new StringBuilder();
		sb.append(str);
	    while (sb.length() < len)
	        sb.insert(0, "0");
	    return sb.toString();
	}

    public static String supplyAllEnd(Object str,int len){
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        while (sb.length() < len)
            sb.insert(str.toString().length(), "0");
        return sb.toString();
    }
}
